package com.hspedu.override_;

/**
 * @Author Stringzhua
 * @Date 2024/3/2 15:47
 * description:编写一个Person类
 * 私有属性/private(name,age)
 * 构造器(无参)
 * 方法say(返回自我介绍的字符串)
 */
public class Person {
    private String name;
    private int age;

    //构造器
    public Person(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    //无参构造器
    public String say() {
        return "名字是=" + name + "  年龄是=" + age;
    }
}
